# -*- tcl -*-
# finite_automaton.test:  tests for the grammar::fa container.
#
# Copyright (c) 2004-2007 by Andreas Kupries <andreas_kupries@users.sourceforge.net>
#
# RCS: @(#) $Id: fa_is_useful.test,v 1.7 2007/04/12 03:43:14 andreas_kupries Exp $

# -------------------------------------------------------------------------

if {![::tcltest::testConstraint runtotal]} {
    ::tcltest::cleanupTests
    return
}

# -------------------------------------------------------------------------
unset -nocomplain expected
array set expected {
    04.xy-.(x,y) _
    04.xy-.(x,xy) _
    04.xy-.(xy,y) _
    05.xye.(x,y) _
    05.xye.(x,xy) _
    05.xye.(xy,y) _
    06.xyee.(x,x) _
    06.xyee.(x,y) _
    06.xyee.(x,xy) _
    06.xyee.(y,x) _
    06.xyee.(y,y) _
    06.xyee.(y,xy) _
    06.xyee.(xy,x) _
    06.xyee.(xy,y) _
    07.xye-.(x,x) _
    07.xye-.(x,y) _
    07.xye-.(x,xy) _
    07.xye-.(y,x) _
    07.xye-.(y,y) _
    07.xye-.(y,xy) _
    07.xye-.(xy,x) _
    07.xye-.(xy,y) _
    08.xy--.(x,x) _
    08.xy--.(x,y) _
    08.xy--.(x,xy) _
    08.xy--.(y,x) _
    08.xy--.(y,y) _
    08.xy--.(y,xy) _
    08.xy--.(xy,x) _
    08.xy--.(xy,y) _
    09.xy-=.(x,x) _
    09.xy-=.(x,y) _
    09.xy-=.(x,xy) _
    09.xy-=.(y,x) _
    09.xy-=.(y,y) _
    09.xy-=.(y,xy) _
    09.xy-=.(xy,x) _
    09.xy-=.(xy,y) _
    10.xyz/ee.(x,yz) _
    10.xyz/ee.(x,xyz) _
    10.xyz/ee.(xy,yz) _
    10.xyz/ee.(xy,xyz) _
    10.xyz/ee.(xz,yz) _
    10.xyz/ee.(xz,xyz) _
    10.xyz/ee.(xyz,yz) _
    11.xyz/e-.(x,yz) _
    11.xyz/e-.(x,xyz) _
    11.xyz/e-.(xy,yz) _
    11.xyz/e-.(xy,xyz) _
    11.xyz/e-.(xz,yz) _
    11.xyz/e-.(xz,xyz) _
    11.xyz/e-.(xyz,yz) _
    12.xyz/--.(x,yz) _
    12.xyz/--.(x,xyz) _
    12.xyz/--.(xy,yz) _
    12.xyz/--.(xy,xyz) _
    12.xyz/--.(xz,yz) _
    12.xyz/--.(xz,xyz) _
    12.xyz/--.(xyz,yz) _
    13.xyz/-=.(x,yz) _
    13.xyz/-=.(x,xyz) _
    13.xyz/-=.(xy,yz) _
    13.xyz/-=.(xy,xyz) _
    13.xyz/-=.(xz,yz) _
    13.xyz/-=.(xz,xyz) _
    13.xyz/-=.(xyz,yz) _
    14.xyz|ee.(xy,z) _
    14.xyz|ee.(xy,xz) _
    14.xyz|ee.(xy,yz) _
    14.xyz|ee.(xy,xyz) _
    14.xyz|ee.(xyz,z) _
    14.xyz|ee.(xyz,xz) _
    14.xyz|ee.(xyz,yz) _
    15.xyz|e-.(xy,z) _
    15.xyz|e-.(xy,xz) _
    15.xyz|e-.(xy,yz) _
    15.xyz|e-.(xy,xyz) _
    15.xyz|e-.(xyz,z) _
    15.xyz|e-.(xyz,xz) _
    15.xyz|e-.(xyz,yz) _
    16.xyz|--.(xy,z) _
    16.xyz|--.(xy,xz) _
    16.xyz|--.(xy,yz) _
    16.xyz|--.(xy,xyz) _
    16.xyz|--.(xyz,z) _
    16.xyz|--.(xyz,xz) _
    16.xyz|--.(xyz,yz) _
    17.xyz|-=.(xy,z) _
    17.xyz|-=.(xy,xz) _
    17.xyz|-=.(xy,yz) _
    17.xyz|-=.(xy,xyz) _
    17.xyz|-=.(xyz,z) _
    17.xyz|-=.(xyz,xz) _
    17.xyz|-=.(xyz,yz) _
    18.xyz+eee.(x,x) _
    18.xyz+eee.(x,y) _
    18.xyz+eee.(x,z) _
    18.xyz+eee.(x,xy) _
    18.xyz+eee.(x,xz) _
    18.xyz+eee.(x,yz) _
    18.xyz+eee.(x,xyz) _
    18.xyz+eee.(y,x) _
    18.xyz+eee.(y,y) _
    18.xyz+eee.(y,z) _
    18.xyz+eee.(y,xy) _
    18.xyz+eee.(y,xz) _
    18.xyz+eee.(y,yz) _
    18.xyz+eee.(y,xyz) _
    18.xyz+eee.(z,x) _
    18.xyz+eee.(z,y) _
    18.xyz+eee.(z,z) _
    18.xyz+eee.(z,xy) _
    18.xyz+eee.(z,xz) _
    18.xyz+eee.(z,yz) _
    18.xyz+eee.(z,xyz) _
    18.xyz+eee.(xy,x) _
    18.xyz+eee.(xy,y) _
    18.xyz+eee.(xy,z) _
    18.xyz+eee.(xy,xy) _
    18.xyz+eee.(xy,xz) _
    18.xyz+eee.(xy,yz) _
    18.xyz+eee.(xy,xyz) _
    18.xyz+eee.(xz,x) _
    18.xyz+eee.(xz,y) _
    18.xyz+eee.(xz,z) _
    18.xyz+eee.(xz,xy) _
    18.xyz+eee.(xz,xz) _
    18.xyz+eee.(xz,yz) _
    18.xyz+eee.(xz,xyz) _
    18.xyz+eee.(yz,x) _
    18.xyz+eee.(yz,y) _
    18.xyz+eee.(yz,z) _
    18.xyz+eee.(yz,xy) _
    18.xyz+eee.(yz,xz) _
    18.xyz+eee.(yz,yz) _
    18.xyz+eee.(yz,xyz) _
    18.xyz+eee.(xyz,x) _
    18.xyz+eee.(xyz,y) _
    18.xyz+eee.(xyz,z) _
    18.xyz+eee.(xyz,xy) _
    18.xyz+eee.(xyz,xz) _
    18.xyz+eee.(xyz,yz) _
    19.xyz+ee-.(x,x) _
    19.xyz+ee-.(x,y) _
    19.xyz+ee-.(x,z) _
    19.xyz+ee-.(x,xy) _
    19.xyz+ee-.(x,xz) _
    19.xyz+ee-.(x,yz) _
    19.xyz+ee-.(x,xyz) _
    19.xyz+ee-.(y,x) _
    19.xyz+ee-.(y,y) _
    19.xyz+ee-.(y,z) _
    19.xyz+ee-.(y,xy) _
    19.xyz+ee-.(y,xz) _
    19.xyz+ee-.(y,yz) _
    19.xyz+ee-.(y,xyz) _
    19.xyz+ee-.(z,x) _
    19.xyz+ee-.(z,y) _
    19.xyz+ee-.(z,z) _
    19.xyz+ee-.(z,xy) _
    19.xyz+ee-.(z,xz) _
    19.xyz+ee-.(z,yz) _
    19.xyz+ee-.(z,xyz) _
    19.xyz+ee-.(xy,x) _
    19.xyz+ee-.(xy,y) _
    19.xyz+ee-.(xy,z) _
    19.xyz+ee-.(xy,xy) _
    19.xyz+ee-.(xy,xz) _
    19.xyz+ee-.(xy,yz) _
    19.xyz+ee-.(xy,xyz) _
    19.xyz+ee-.(xz,x) _
    19.xyz+ee-.(xz,y) _
    19.xyz+ee-.(xz,z) _
    19.xyz+ee-.(xz,xy) _
    19.xyz+ee-.(xz,xz) _
    19.xyz+ee-.(xz,yz) _
    19.xyz+ee-.(xz,xyz) _
    19.xyz+ee-.(yz,x) _
    19.xyz+ee-.(yz,y) _
    19.xyz+ee-.(yz,z) _
    19.xyz+ee-.(yz,xy) _
    19.xyz+ee-.(yz,xz) _
    19.xyz+ee-.(yz,yz) _
    19.xyz+ee-.(yz,xyz) _
    19.xyz+ee-.(xyz,x) _
    19.xyz+ee-.(xyz,y) _
    19.xyz+ee-.(xyz,z) _
    19.xyz+ee-.(xyz,xy) _
    19.xyz+ee-.(xyz,xz) _
    19.xyz+ee-.(xyz,yz) _
    20.xyz+e--.(x,x) _
    20.xyz+e--.(x,y) _
    20.xyz+e--.(x,z) _
    20.xyz+e--.(x,xy) _
    20.xyz+e--.(x,xz) _
    20.xyz+e--.(x,yz) _
    20.xyz+e--.(x,xyz) _
    20.xyz+e--.(y,x) _
    20.xyz+e--.(y,y) _
    20.xyz+e--.(y,z) _
    20.xyz+e--.(y,xy) _
    20.xyz+e--.(y,xz) _
    20.xyz+e--.(y,yz) _
    20.xyz+e--.(y,xyz) _
    20.xyz+e--.(z,x) _
    20.xyz+e--.(z,y) _
    20.xyz+e--.(z,z) _
    20.xyz+e--.(z,xy) _
    20.xyz+e--.(z,xz) _
    20.xyz+e--.(z,yz) _
    20.xyz+e--.(z,xyz) _
    20.xyz+e--.(xy,x) _
    20.xyz+e--.(xy,y) _
    20.xyz+e--.(xy,z) _
    20.xyz+e--.(xy,xy) _
    20.xyz+e--.(xy,xz) _
    20.xyz+e--.(xy,yz) _
    20.xyz+e--.(xy,xyz) _
    20.xyz+e--.(xz,x) _
    20.xyz+e--.(xz,y) _
    20.xyz+e--.(xz,z) _
    20.xyz+e--.(xz,xy) _
    20.xyz+e--.(xz,xz) _
    20.xyz+e--.(xz,yz) _
    20.xyz+e--.(xz,xyz) _
    20.xyz+e--.(yz,x) _
    20.xyz+e--.(yz,y) _
    20.xyz+e--.(yz,z) _
    20.xyz+e--.(yz,xy) _
    20.xyz+e--.(yz,xz) _
    20.xyz+e--.(yz,yz) _
    20.xyz+e--.(yz,xyz) _
    20.xyz+e--.(xyz,x) _
    20.xyz+e--.(xyz,y) _
    20.xyz+e--.(xyz,z) _
    20.xyz+e--.(xyz,xy) _
    20.xyz+e--.(xyz,xz) _
    20.xyz+e--.(xyz,yz) _
    21.xyz+e-=.(x,x) _
    21.xyz+e-=.(x,y) _
    21.xyz+e-=.(x,z) _
    21.xyz+e-=.(x,xy) _
    21.xyz+e-=.(x,xz) _
    21.xyz+e-=.(x,yz) _
    21.xyz+e-=.(x,xyz) _
    21.xyz+e-=.(y,x) _
    21.xyz+e-=.(y,y) _
    21.xyz+e-=.(y,z) _
    21.xyz+e-=.(y,xy) _
    21.xyz+e-=.(y,xz) _
    21.xyz+e-=.(y,yz) _
    21.xyz+e-=.(y,xyz) _
    21.xyz+e-=.(z,x) _
    21.xyz+e-=.(z,y) _
    21.xyz+e-=.(z,z) _
    21.xyz+e-=.(z,xy) _
    21.xyz+e-=.(z,xz) _
    21.xyz+e-=.(z,yz) _
    21.xyz+e-=.(z,xyz) _
    21.xyz+e-=.(xy,x) _
    21.xyz+e-=.(xy,y) _
    21.xyz+e-=.(xy,z) _
    21.xyz+e-=.(xy,xy) _
    21.xyz+e-=.(xy,xz) _
    21.xyz+e-=.(xy,yz) _
    21.xyz+e-=.(xy,xyz) _
    21.xyz+e-=.(xz,x) _
    21.xyz+e-=.(xz,y) _
    21.xyz+e-=.(xz,z) _
    21.xyz+e-=.(xz,xy) _
    21.xyz+e-=.(xz,xz) _
    21.xyz+e-=.(xz,yz) _
    21.xyz+e-=.(xz,xyz) _
    21.xyz+e-=.(yz,x) _
    21.xyz+e-=.(yz,y) _
    21.xyz+e-=.(yz,z) _
    21.xyz+e-=.(yz,xy) _
    21.xyz+e-=.(yz,xz) _
    21.xyz+e-=.(yz,yz) _
    21.xyz+e-=.(yz,xyz) _
    21.xyz+e-=.(xyz,x) _
    21.xyz+e-=.(xyz,y) _
    21.xyz+e-=.(xyz,z) _
    21.xyz+e-=.(xyz,xy) _
    21.xyz+e-=.(xyz,xz) _
    21.xyz+e-=.(xyz,yz) _
    22.xyz+---.(x,x) _
    22.xyz+---.(x,y) _
    22.xyz+---.(x,z) _
    22.xyz+---.(x,xy) _
    22.xyz+---.(x,xz) _
    22.xyz+---.(x,yz) _
    22.xyz+---.(x,xyz) _
    22.xyz+---.(y,x) _
    22.xyz+---.(y,y) _
    22.xyz+---.(y,z) _
    22.xyz+---.(y,xy) _
    22.xyz+---.(y,xz) _
    22.xyz+---.(y,yz) _
    22.xyz+---.(y,xyz) _
    22.xyz+---.(z,x) _
    22.xyz+---.(z,y) _
    22.xyz+---.(z,z) _
    22.xyz+---.(z,xy) _
    22.xyz+---.(z,xz) _
    22.xyz+---.(z,yz) _
    22.xyz+---.(z,xyz) _
    22.xyz+---.(xy,x) _
    22.xyz+---.(xy,y) _
    22.xyz+---.(xy,z) _
    22.xyz+---.(xy,xy) _
    22.xyz+---.(xy,xz) _
    22.xyz+---.(xy,yz) _
    22.xyz+---.(xy,xyz) _
    22.xyz+---.(xz,x) _
    22.xyz+---.(xz,y) _
    22.xyz+---.(xz,z) _
    22.xyz+---.(xz,xy) _
    22.xyz+---.(xz,xz) _
    22.xyz+---.(xz,yz) _
    22.xyz+---.(xz,xyz) _
    22.xyz+---.(yz,x) _
    22.xyz+---.(yz,y) _
    22.xyz+---.(yz,z) _
    22.xyz+---.(yz,xy) _
    22.xyz+---.(yz,xz) _
    22.xyz+---.(yz,yz) _
    22.xyz+---.(yz,xyz) _
    22.xyz+---.(xyz,x) _
    22.xyz+---.(xyz,y) _
    22.xyz+---.(xyz,z) _
    22.xyz+---.(xyz,xy) _
    22.xyz+---.(xyz,xz) _
    22.xyz+---.(xyz,yz) _
    23.xyz+--=.(x,x) _
    23.xyz+--=.(x,y) _
    23.xyz+--=.(x,z) _
    23.xyz+--=.(x,xy) _
    23.xyz+--=.(x,xz) _
    23.xyz+--=.(x,yz) _
    23.xyz+--=.(x,xyz) _
    23.xyz+--=.(y,x) _
    23.xyz+--=.(y,y) _
    23.xyz+--=.(y,z) _
    23.xyz+--=.(y,xy) _
    23.xyz+--=.(y,xz) _
    23.xyz+--=.(y,yz) _
    23.xyz+--=.(y,xyz) _
    23.xyz+--=.(z,x) _
    23.xyz+--=.(z,y) _
    23.xyz+--=.(z,z) _
    23.xyz+--=.(z,xy) _
    23.xyz+--=.(z,xz) _
    23.xyz+--=.(z,yz) _
    23.xyz+--=.(z,xyz) _
    23.xyz+--=.(xy,x) _
    23.xyz+--=.(xy,y) _
    23.xyz+--=.(xy,z) _
    23.xyz+--=.(xy,xy) _
    23.xyz+--=.(xy,xz) _
    23.xyz+--=.(xy,yz) _
    23.xyz+--=.(xy,xyz) _
    23.xyz+--=.(xz,x) _
    23.xyz+--=.(xz,y) _
    23.xyz+--=.(xz,z) _
    23.xyz+--=.(xz,xy) _
    23.xyz+--=.(xz,xz) _
    23.xyz+--=.(xz,yz) _
    23.xyz+--=.(xz,xyz) _
    23.xyz+--=.(yz,x) _
    23.xyz+--=.(yz,y) _
    23.xyz+--=.(yz,z) _
    23.xyz+--=.(yz,xy) _
    23.xyz+--=.(yz,xz) _
    23.xyz+--=.(yz,yz) _
    23.xyz+--=.(yz,xyz) _
    23.xyz+--=.(xyz,x) _
    23.xyz+--=.(xyz,y) _
    23.xyz+--=.(xyz,z) _
    23.xyz+--=.(xyz,xy) _
    23.xyz+--=.(xyz,xz) _
    23.xyz+--=.(xyz,yz) _
    24.xyz+-=_.(x,x) _
    24.xyz+-=_.(x,y) _
    24.xyz+-=_.(x,z) _
    24.xyz+-=_.(x,xy) _
    24.xyz+-=_.(x,xz) _
    24.xyz+-=_.(x,yz) _
    24.xyz+-=_.(x,xyz) _
    24.xyz+-=_.(y,x) _
    24.xyz+-=_.(y,y) _
    24.xyz+-=_.(y,z) _
    24.xyz+-=_.(y,xy) _
    24.xyz+-=_.(y,xz) _
    24.xyz+-=_.(y,yz) _
    24.xyz+-=_.(y,xyz) _
    24.xyz+-=_.(z,x) _
    24.xyz+-=_.(z,y) _
    24.xyz+-=_.(z,z) _
    24.xyz+-=_.(z,xy) _
    24.xyz+-=_.(z,xz) _
    24.xyz+-=_.(z,yz) _
    24.xyz+-=_.(z,xyz) _
    24.xyz+-=_.(xy,x) _
    24.xyz+-=_.(xy,y) _
    24.xyz+-=_.(xy,z) _
    24.xyz+-=_.(xy,xy) _
    24.xyz+-=_.(xy,xz) _
    24.xyz+-=_.(xy,yz) _
    24.xyz+-=_.(xy,xyz) _
    24.xyz+-=_.(xz,x) _
    24.xyz+-=_.(xz,y) _
    24.xyz+-=_.(xz,z) _
    24.xyz+-=_.(xz,xy) _
    24.xyz+-=_.(xz,xz) _
    24.xyz+-=_.(xz,yz) _
    24.xyz+-=_.(xz,xyz) _
    24.xyz+-=_.(yz,x) _
    24.xyz+-=_.(yz,y) _
    24.xyz+-=_.(yz,z) _
    24.xyz+-=_.(yz,xy) _
    24.xyz+-=_.(yz,xz) _
    24.xyz+-=_.(yz,yz) _
    24.xyz+-=_.(yz,xyz) _
    24.xyz+-=_.(xyz,x) _
    24.xyz+-=_.(xyz,y) _
    24.xyz+-=_.(xyz,z) _
    24.xyz+-=_.(xyz,xy) _
    24.xyz+-=_.(xyz,xz) _
    24.xyz+-=_.(xyz,yz) _
    25.xyz&eee.(x,z) _
    25.xyz&eee.(x,xz) _
    25.xyz&eee.(x,yz) _
    25.xyz&eee.(x,xyz) _
    25.xyz&eee.(xy,z) _
    25.xyz&eee.(xy,xz) _
    25.xyz&eee.(xy,yz) _
    25.xyz&eee.(xy,xyz) _
    25.xyz&eee.(xz,z) _
    25.xyz&eee.(xz,xz) _
    25.xyz&eee.(xz,yz) _
    25.xyz&eee.(xz,xyz) _
    25.xyz&eee.(xyz,z) _
    25.xyz&eee.(xyz,xz) _
    25.xyz&eee.(xyz,yz) _
    26.xyz&ee-.(x,z) _
    26.xyz&ee-.(x,xz) _
    26.xyz&ee-.(x,yz) _
    26.xyz&ee-.(x,xyz) _
    26.xyz&ee-.(xy,z) _
    26.xyz&ee-.(xy,xz) _
    26.xyz&ee-.(xy,yz) _
    26.xyz&ee-.(xy,xyz) _
    26.xyz&ee-.(xz,z) _
    26.xyz&ee-.(xz,xz) _
    26.xyz&ee-.(xz,yz) _
    26.xyz&ee-.(xz,xyz) _
    26.xyz&ee-.(xyz,z) _
    26.xyz&ee-.(xyz,xz) _
    26.xyz&ee-.(xyz,yz) _
    27.xyz&e--.(x,z) _
    27.xyz&e--.(x,xz) _
    27.xyz&e--.(x,yz) _
    27.xyz&e--.(x,xyz) _
    27.xyz&e--.(xy,z) _
    27.xyz&e--.(xy,xz) _
    27.xyz&e--.(xy,yz) _
    27.xyz&e--.(xy,xyz) _
    27.xyz&e--.(xz,z) _
    27.xyz&e--.(xz,xz) _
    27.xyz&e--.(xz,yz) _
    27.xyz&e--.(xz,xyz) _
    27.xyz&e--.(xyz,z) _
    27.xyz&e--.(xyz,xz) _
    27.xyz&e--.(xyz,yz) _
    28.xyz&e-=.(x,z) _
    28.xyz&e-=.(x,xz) _
    28.xyz&e-=.(x,yz) _
    28.xyz&e-=.(x,xyz) _
    28.xyz&e-=.(xy,z) _
    28.xyz&e-=.(xy,xz) _
    28.xyz&e-=.(xy,yz) _
    28.xyz&e-=.(xy,xyz) _
    28.xyz&e-=.(xz,z) _
    28.xyz&e-=.(xz,xz) _
    28.xyz&e-=.(xz,yz) _
    28.xyz&e-=.(xz,xyz) _
    28.xyz&e-=.(xyz,z) _
    28.xyz&e-=.(xyz,xz) _
    28.xyz&e-=.(xyz,yz) _
    29.xyz&---.(x,z) _
    29.xyz&---.(x,xz) _
    29.xyz&---.(x,yz) _
    29.xyz&---.(x,xyz) _
    29.xyz&---.(xy,z) _
    29.xyz&---.(xy,xz) _
    29.xyz&---.(xy,yz) _
    29.xyz&---.(xy,xyz) _
    29.xyz&---.(xz,z) _
    29.xyz&---.(xz,xz) _
    29.xyz&---.(xz,yz) _
    29.xyz&---.(xz,xyz) _
    29.xyz&---.(xyz,z) _
    29.xyz&---.(xyz,xz) _
    29.xyz&---.(xyz,yz) _
    30.xyz&--=.(x,z) _
    30.xyz&--=.(x,xz) _
    30.xyz&--=.(x,yz) _
    30.xyz&--=.(x,xyz) _
    30.xyz&--=.(xy,z) _
    30.xyz&--=.(xy,xz) _
    30.xyz&--=.(xy,yz) _
    30.xyz&--=.(xy,xyz) _
    30.xyz&--=.(xz,z) _
    30.xyz&--=.(xz,xz) _
    30.xyz&--=.(xz,yz) _
    30.xyz&--=.(xz,xyz) _
    30.xyz&--=.(xyz,z) _
    30.xyz&--=.(xyz,xz) _
    30.xyz&--=.(xyz,yz) _
    31.xyz&-=_.(x,z) _
    31.xyz&-=_.(x,xz) _
    31.xyz&-=_.(x,yz) _
    31.xyz&-=_.(x,xyz) _
    31.xyz&-=_.(xy,z) _
    31.xyz&-=_.(xy,xz) _
    31.xyz&-=_.(xy,yz) _
    31.xyz&-=_.(xy,xyz) _
    31.xyz&-=_.(xz,z) _
    31.xyz&-=_.(xz,xz) _
    31.xyz&-=_.(xz,yz) _
    31.xyz&-=_.(xz,xyz) _
    31.xyz&-=_.(xyz,z) _
    31.xyz&-=_.(xyz,xz) _
    31.xyz&-=_.(xyz,yz) _
    32.xyz!ee.(x,z) _
    32.xyz!ee.(x,xz) _
    32.xyz!ee.(x,yz) _
    32.xyz!ee.(x,xyz) _
    32.xyz!ee.(xy,z) _
    32.xyz!ee.(xy,xz) _
    32.xyz!ee.(xy,yz) _
    32.xyz!ee.(xy,xyz) _
    32.xyz!ee.(xz,z) _
    32.xyz!ee.(xz,xz) _
    32.xyz!ee.(xz,yz) _
    32.xyz!ee.(xz,xyz) _
    32.xyz!ee.(xyz,z) _
    32.xyz!ee.(xyz,xz) _
    32.xyz!ee.(xyz,yz) _
    33.xyz!e-.(x,z) _
    33.xyz!e-.(x,xz) _
    33.xyz!e-.(x,yz) _
    33.xyz!e-.(x,xyz) _
    33.xyz!e-.(xy,z) _
    33.xyz!e-.(xy,xz) _
    33.xyz!e-.(xy,yz) _
    33.xyz!e-.(xy,xyz) _
    33.xyz!e-.(xz,z) _
    33.xyz!e-.(xz,xz) _
    33.xyz!e-.(xz,yz) _
    33.xyz!e-.(xz,xyz) _
    33.xyz!e-.(xyz,z) _
    33.xyz!e-.(xyz,xz) _
    33.xyz!e-.(xyz,yz) _
    34.xyz!--.(x,z) _
    34.xyz!--.(x,xz) _
    34.xyz!--.(x,yz) _
    34.xyz!--.(x,xyz) _
    34.xyz!--.(xy,z) _
    34.xyz!--.(xy,xz) _
    34.xyz!--.(xy,yz) _
    34.xyz!--.(xy,xyz) _
    34.xyz!--.(xz,z) _
    34.xyz!--.(xz,xz) _
    34.xyz!--.(xz,yz) _
    34.xyz!--.(xz,xyz) _
    34.xyz!--.(xyz,z) _
    34.xyz!--.(xyz,xz) _
    34.xyz!--.(xyz,yz) _
    35.xyz!-=.(x,z) _
    35.xyz!-=.(x,xz) _
    35.xyz!-=.(x,yz) _
    35.xyz!-=.(x,xyz) _
    35.xyz!-=.(xy,z) _
    35.xyz!-=.(xy,xz) _
    35.xyz!-=.(xy,yz) _
    35.xyz!-=.(xy,xyz) _
    35.xyz!-=.(xz,z) _
    35.xyz!-=.(xz,xz) _
    35.xyz!-=.(xz,yz) _
    35.xyz!-=.(xz,xyz) _
    35.xyz!-=.(xyz,z) _
    35.xyz!-=.(xyz,xz) _
    35.xyz!-=.(xyz,yz) _
    36.xyz!-e.(x,z) _
    36.xyz!-e.(x,xz) _
    36.xyz!-e.(x,yz) _
    36.xyz!-e.(x,xyz) _
    36.xyz!-e.(xy,z) _
    36.xyz!-e.(xy,xz) _
    36.xyz!-e.(xy,yz) _
    36.xyz!-e.(xy,xyz) _
    36.xyz!-e.(xz,z) _
    36.xyz!-e.(xz,xz) _
    36.xyz!-e.(xz,yz) _
    36.xyz!-e.(xz,xyz) _
    36.xyz!-e.(xyz,z) _
    36.xyz!-e.(xyz,xz) _
    36.xyz!-e.(xyz,yz) _
}

foreach {n code} {
    00 x
    01 x-
    02 xe
    03 xy
    04 xy-
    05 xye
    06 xyee
    07 xye-
    08 xy--
    09 xy-=
    10 xyz/ee
    11 xyz/e-
    12 xyz/--
    13 xyz/-=
    14 xyz|ee
    15 xyz|e-
    16 xyz|--
    17 xyz|-=
    18 xyz+eee
    19 xyz+ee-
    20 xyz+e--
    21 xyz+e-=
    22 xyz+---
    23 xyz+--=
    24 xyz+-=_
    25 xyz&eee
    26 xyz&ee-
    27 xyz&e--
    28 xyz&e-=
    29 xyz&---
    30 xyz&--=
    31 xyz&-=_
    32 xyz!ee
    33 xyz!e-
    34 xyz!--
    35 xyz!-=
    36 xyz!-e
} {
    if {[string match xyz* $code]} {
	set sets {{} x y z {x y} {x z} {y z} {x y z}}
	set max 2
    } elseif {[string match xy* $code]} {
	set sets {{} x y {x y}}
	set max 1
    } elseif {[string match x* $code]} {
	set sets {{} x}
	set max 0
    } else {
	set sets {{}}
	set max 4
    }

    foreach st $sets {
	foreach fin $sets {
	    set key $n.$code.([join $st {}],[join $fin {}])

	    if {
		([join $st {}] eq [join $fin {}]) &&
		([join $st {}] eq [string range $code 0 $max])
	    } {
		# If all states are both start and final the FA cannot
		# be other than useful.
		set expected($key) .
	    }

	    test fa-is-${setimpl}-useful-1.$key {is useful} {
		grammar::fa a
		gen $code
		a start set $st
		a final set $fin
		set res [a is useful]
		a destroy
		set res
	    } [info exists expected($key)] ;# {}
	}
    }
}


#parray expected
unset   expected


# -------------------------------------------------------------------------
::tcltest::cleanupTests
